﻿@model DAEProde.Domain.MatchDate

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Administración de Partidos</h2>

<p>
    @Html.ActionLink("Nuevo Partido", "Create", new { id = Model.Id })
</p>

<table>
    <tr>
        <th>
            Fecha Partido
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model.Matches) {
        <tr>
            <td>
                @item.Date.ToShortDateString()
            </td>
            <td>
                @Html.ActionLink("Editar", "Edit", new { id = item.Id }) |
                @Html.ActionLink("Detalles", "Details", new { id = item.Id }) |
                
                @using (Html.BeginForm("Delete", "MatchManager", FormMethod.Post, new { style = "display:inline" }))
                {
                    @Html.AntiForgeryToken()
                    @Html.Hidden("id", item.Id)
                    <input type="submit" value="Borrar" />
                }      
            </td>
        </tr>
    }
</table>

<p>
    @Html.ActionLink("Volver", "Index", "MatchDateManager", new { id = Model.Tournament.Id }, null)
</p>
